﻿<Page
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:VMDS_GUIClient_Model="clr-namespace:VMDS.GUIClient.Model" xmlns:VMDS_GUIClient_ViewModels_Management_VMs="clr-namespace:VMDS.GUIClient.ViewModels.Management.VMs" xmlns:VMDS_GUIClient_Views_Management_VMs="clr-namespace:VMDS.GUIClient.Views.Management.VMs" x:Class="VMDS.GUIClient.Views.Management.VmManagement" 
      mc:Ignorable="d" 
      d:DesignHeight="400" d:DesignWidth="736"
	Title="VmManagement">
	<Page.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/VMDS.GUIClient;component/Views/AutoScrollListBoxDictionary.xaml"/>
			</ResourceDictionary.MergedDictionaries>
			<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
			<VMDS_GUIClient_Model:ManagerDataStore x:Key="ManagerDataStoreDataSource" d:IsDataSource="True"/>
		</ResourceDictionary>
	</Page.Resources>

	<Page.DataContext>
		<VMDS_GUIClient_ViewModels_Management_VMs:VmManagementViewModel/>
	</Page.DataContext>

    <Grid>
    	<Grid.ColumnDefinitions>
    		<ColumnDefinition Width="0.322*"/>
    		<ColumnDefinition Width="0.678*"/>
    	</Grid.ColumnDefinitions>
    	<Rectangle Margin="5" Stroke="#FFF8F3F3" StrokeThickness="0.5" RadiusX="10" RadiusY="10" Grid.ColumnSpan="2">
    		<Rectangle.Fill>
    			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="0.435">
    				<LinearGradientBrush.RelativeTransform>
    					<TransformGroup>
    						<ScaleTransform CenterY="0.5" CenterX="0.5"/>
    						<SkewTransform CenterY="0.5" CenterX="0.5"/>
    						<RotateTransform CenterY="0.5" CenterX="0.5"/>
    						<TranslateTransform/>
    					</TransformGroup>
    				</LinearGradientBrush.RelativeTransform>
    				<GradientStop Color="#FFEFECEC"/>
    				<GradientStop Offset="0.558"/>
    				<GradientStop Color="#FFEFECEC" Offset="1"/>
    				<GradientStop Offset="0.494"/>
    			</LinearGradientBrush>
    		</Rectangle.Fill>
    	</Rectangle>
    	<ListBox Margin="24,12.193,-4,0" ItemTemplate="{DynamicResource MyEquityTemplate3}" Height="144" VerticalAlignment="Top" ItemsSource="{Binding VMs}" SelectedItem="{Binding CurrentVM, Mode=TwoWay}"/>
    	<TextBlock Grid.Column="1" HorizontalAlignment="Left" Height="24" Margin="8,8,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="112" FontSize="18.667"><Run Language="ru-ru" Text="Название"/><LineBreak/><Run Language="ru-ru"/></TextBlock>
    	<TextBox Grid.Column="1" Height="24" Margin="144.08,12.193,80,0" TextWrapping="Wrap" Text="{Binding VmName}" VerticalAlignment="Top"/>
    	<TextBlock Grid.Column="1" HorizontalAlignment="Left" Height="24" Margin="8,48,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="112" FontSize="18.667"><Run Language="ru-ru" Text="Описание"/><LineBreak/><Run Language="ru-ru"/></TextBlock>
    	<TextBox Grid.Column="1" Height="60" Margin="144.08,52.193,24,0" TextWrapping="Wrap" Text="{Binding VmDescr}" VerticalAlignment="Top"/>
    	<Button Content="Изменить" Grid.Column="1" HorizontalAlignment="Right" Height="24" Margin="0,0,8,48" VerticalAlignment="Bottom" Width="88" Command="{Binding Change, Mode=OneWay}"/>
    	<ListBox Grid.Column="1" Margin="144.08,136,144,0"  ItemTemplate="{DynamicResource ScreenShotTemplate2}" ItemsSource="{Binding Screenshots}" Height="152" VerticalAlignment="Top"/>
    	<Button Content="+" Grid.Column="1" HorizontalAlignment="Right" Height="24" Margin="0,136,96,0" VerticalAlignment="Top" Width="32" Command="{Binding AddScr, Mode=OneWay}"/>
    	<Button Content="-" Grid.Column="1" HorizontalAlignment="Right" Height="24" Margin="0,164,96,0" VerticalAlignment="Top" Width="32"/>
		<Rectangle x:Name="rectangle" Visibility="{Binding AddScrVisible, Converter={StaticResource BooleanToVisibilityConverter}}"></Rectangle>
    	<VMDS_GUIClient_Views_Management_VMs:ScreenModalDialog d:LayoutOverrides="Width" Grid.ColumnSpan="2" Grid.RowSpan="2" Visibility="{Binding Visibility, ElementName=rectangle, Mode=TwoWay}" />
    </Grid>
</Page>
